1. Field of the Invention
The present invention relates to a method and apparatus for detecting mark image data corresponding to a mark from image data.
2. Description of the Related Art
In order to detect a mark, e.g., a rectangular mark, printed or written on paper on the basis of analog image data input through a camera or the like, mark image data itself corresponding to the mark or its central position must be detected. Assume, in this case, that desired mark image data represented by the image data has a horizontal length FH and a vertical length FV in units of pixels, as shown in FIG. 1.
In a conventional mark detecting apparatus, therefore, image data input through a camera or the like is converted into digital data first. Horizontal and vertical lengths FH' and FV' of actual mark image data in the digital image data are then measured. The measured lengths FH' and FV' are respectively compared with the known lengths FH and FV, and hence a rectangular mark is detected.
In the above method, in order to digitalize analog image data input through a camera or the like, each pixel is sampled from the analog image data, and the amplitude of the analog image data upon each sampling is converted into a binary value. As a result, the boundary of the mark image data is detected. That is, the density data of each pixel of the analog image data is compared with a threshold value. In accordance with the comparison result, the pixel is represented by binary data which indicates whether the pixel is present within the mark image data or not. However, the difference in density between the mark image data and another portion varies depending on external light radiated on the paper, or the like, on which the mark is written. As shown in FIG. 2A, therefore, if an actual threshold value is lower than a desired threshold value, mark image data smaller than the real one is detected. In contrast to this, as shown in FIG. 2B, if an actual threshold value is higher than a desired threshold value, mark image data larger than the real one is detected. As a result, the mark cannot be properly detected.
As described above, in the conventional mark detecting method, if input analog image data cannot be properly digitalized with a predetermined threshold value due to the influences of changes in external light, illumination from one direction, and the like, the lengths of mark image data cannot be properly measured, resulting in a decrease in mark detection precision.